#include "videoshow.h"
#include "ui_videoshow.h"
#include <QDebug>

VideoShow::VideoShow(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::VideoShow)
    ,mouseAcute(20)
{
    ui->setupUi(this);
    ui->label_img->setMouseTracking(true);
    ui->label_img->setScaledContents(true);
}

VideoShow::~VideoShow()
{
    delete ui;
}

QLabel *VideoShow::getImgLab()
{
    return ui->label_img;
}


void VideoShow::mouseMoveEvent(QMouseEvent *event)
{
    QPoint center(ui->label_img->x() + ui->label_img->width() / 2,
                  ui->label_img->y() + ui->label_img->height() / 2);
    center = this->mapToGlobal(center);
    QPoint movePos = cursor().pos() - center;
    QCursor::setPos(center);
    emit sPosChanged(movePos);
    //qDebug()<<"mouse movePos:"<<movePos;
}
